package com.cai.controller;

import com.cai.server.Tests1;
import com.cai.server.Tests2;
import com.cai.server.WebServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;

@RestController
@RequestMapping("msg")
public class SendMsgController {
    @Autowired
    WebServer webServer;
    @Autowired
    Tests1 tests1;
    @Autowired
    Tests2 tests2;
    @GetMapping("/server")
    public String server(){
        webServer.task();
        return "开启成功";
    }

    @GetMapping("/client1/{message}")
    public String client1(@PathVariable String message){
        return tests1.client1(message);
    }

    @GetMapping("/client2/{message}")
    public String client2(@PathVariable String message){
        return tests2.client2(message);
    }

}
